<!DOCTYPE html>
<html lang="en">
<head>
<base href="${contextPath}/" />
    <meta charset="utf-8">
    <title>国际学院学生数据管理</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="Charisma, a fully featured, responsive, HTML5, Bootstrap admin template.">
    <meta name="author" content="Muhammad Usman">

    <!-- The styles -->
    <link id="bs-css" href="css/bootstrap-cerulean.min.css" rel="stylesheet">
    <link href="css/charisma-app.css" rel="stylesheet">
    <link href='bower_components/chosen/chosen.min.css' rel='stylesheet'>
    <link href='bower_components/colorbox/example3/colorbox.css' rel='stylesheet'>
    <link href='css/jquery.noty.css' rel='stylesheet'>
    <link href='css/noty_theme_default.css' rel='stylesheet'>
    <link href='css/jquery.iphone.toggle.css' rel='stylesheet'>
    <link href='css/animate.min.css' rel='stylesheet'>
    <link rel="stylesheet" media="screen" type="text/css" href="css/datepicker.css" />
    <link rel="stylesheet" href="css/datepicker.css" type="text/css" />
	
    <title>DatePicker - jQuery plugin- Download: http://www.jb51.net</title>
    <!-- jQuery -->
  	<script src="images/jquery.js"></script>
  	
    <!-- The HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    <!-- The fav icon -->
    <link rel="shortcut icon" href="img/favicon.ico">

</head>

<body>
    <!-- topbar starts -->
	<#include "commonPage/top.ftl">
	<!-- topbar ends -->
	<div class="ch-container">
		<div class="row">

			<!-- left menu starts -->
			<#include "commonPage/left.ftl">
			<!--/span-->
			<!-- left menu ends -->

       

        <div id="content" class="col-lg-10 col-sm-10">
            <!-- content starts -->
              
    <div class="row">
    <div class="box col-md-12">
    <div class="box-inner">
    <div class="box-header well" data-original-title="">
        <h2><i class=" glyphicon glyphicon-list-alt"></i>设置校历开始日期</h2>
    </div>
    <div class="box-content">
	
    <table class="table table-striped table-bordered bootstrap-datatable datatable responsive">
	<form id="uploadForm" action="${contextPath}/stu/setDate" method="post">
        <div class="form-group has-warning col-md-4">
            
            <label class="control-label" for="inputWarning1">请选择日期</label> 
            <div class="controls">						
			学年：<select name="term" id="term">
						<option value="${year-1!}-${year!}-1">${year-1!}-${year!}-1</option>
						<option value="${year-1!}-${year!}-2">${year-1!}-${year!}-2</option>
						<option value="${year!}-${year+1!}-1">${year!}-${year+1!}-1</option>
						<option value="${year!}-${year+1!}-2">${year!}-${year+1!}-2</option>
					</select>
			<br>
			<br>
			  日期：<input  name="inputDate" type="text" id="inputDate">
			</div>
		    <br>
			<button type="button" onclick="javascript:tijaio();">提交</button>
        </div>
        </FORM>
    </table>
    
    </div>
    </div>
    </div>
    <!--/span-->

    </div><!--/row-->



    <!-- content ends -->
    </div><!--/#content.col-md-0-->
</div><!--/fluid-row-->

    <!-- Ad, you can remove it -->

    <!-- Ad ends -->

    <hr>

</div><!--/.fluid-container-->

<!-- external javascript -->

<script src="bower_components/bootstrap/dist/js/bootstrap.min.js"></script>

<!-- library for cookie management -->
<!-- calender plugin -->
<script src='bower_components/moment/min/moment.min.js'></script>
<script src='bower_components/fullcalendar/dist/fullcalendar.min.js'></script>
<!-- data table plugin -->

<!-- select or dropdown enhancer -->
<script src="bower_components/chosen/chosen.jquery.min.js"></script>
<!-- plugin for gallery image view -->
<script src="bower_components/colorbox/jquery.colorbox-min.js"></script>
<!-- notification plugin -->
<script src="js/jquery.noty.js"></script>
<!-- library for making tables responsive -->
<!-- tour plugin -->
<!-- star rating plugin -->
<script src="js/jquery.raty.min.js"></script>
<!-- for iOS style toggle switch -->
<script src="js/jquery.iphone.toggle.js"></script>
<!-- autogrowing textarea plugin -->
<script src="js/jquery.autogrow-textarea.js"></script>
<!-- multiple file upload plugin -->
<!-- history.js for cross-browser state change on ajax -->
<!-- application script for Charisma demo -->
<script type="text/javascript" src="js/datepicker.js"></script>
<script type="text/javascript" src="js/eye.js"></script>
<script type="text/javascript" src="js/utils.js"></script>
<script type="text/javascript" src="js/layout.js"></script>
<script type="text/javascript">
	$('#inputDate').DatePicker({
		format:'Y-m-d',
	 	date: $('#inputDate').val(),
		current: $('#inputDate').val(),
		starts: 1,
		position: 'r',
		onBeforeShow: function(){
			$('#inputDate').DatePickerSetDate($('#inputDate').val(), true);
		},
		onChange: function(formated, dates){
			$('#inputDate').val(formated);
		}
	});

function tijaio(){
	$.ajax({
		type:"post",
		url:"stu/setDate",
		data:{
			inputDate:$("#inputDate").val(),
			term:$("#term").val(),
		},
		dataType:"json",
		success : function(data){
			alert(data.message);
		},
		error: function(){
		    alert("失败");
		}
	});
		
}
</script>
</body>
</html>
